<!DOCTYPE html>
<html lang="zh">
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="common/header :: header(~{::title},~{::link},~{})">
    <title>文章详情</title>
    <link rel="stylesheet" th:href="@{/css/jianshu.css}"/>
    <link rel="stylesheet" th:href="@{/css/style.css}"/>
    <link rel="stylesheet" th:href="@{/css/content.css}"/>
    <link rel="stylesheet" th:href="@{/assets/lib/editor.md-master/css/editormd.preview.css}"/>
</head>
<body style="margin-bottom: 60px;">
<!--导航-->
<!--<div th:replace="common/nav :: nav"></div>-->
<div class="container-fluid">
    <div class="row">

        <div class="col-md-12 column">
            <div class="articleContent">
                <h3 class="title" th:text="${entity.title}">
                    tiltle
                </h3>
                <div class="property">
                    <span><small>文章来源</small>：<span th:text="${entity.originated==1?'原创':entity.source}">原创</span></span>&nbsp;&nbsp;
                    <span><small>作者：</small><span th:text="${entity.author}"></span></span>&nbsp;&nbsp;
                    <span><small>发布时间：</small><span th:text="${#dates.format(entity.createTime, 'yyyy-MM-dd')}"></span></span>&nbsp;&nbsp;
                    <span><small>阅读：</small><span th:text="${entity.readNum}">100</span></span>&nbsp;&nbsp;
                    <span><small>标签：</small><span th:text="${entity.tagNames}"></span></span>
                </div>
            </div>
        </div>
    </div>
    <div class="mdBox">
        <!--左侧内容-->
        <div class="left" id="content">
            <textarea style="display:none;" th:text="${entity.content}">i am content</textarea>
        </div>
        <!--右侧目录-->
        <div class="right" id="toc">

        </div>
    </div>
</div>
<!-- 引入通用js-->
<div th:replace="common/footer :: footer"></div>
<div th:replace="common/footer-md :: footer-md"></div>
<script>
    /*markdown 转html展示*/
    editormd.markdownToHTML("content", {
        markdown: $("textarea").val(), //+ "\r\n" + $("#append-test").text(),
        //htmlDecode      : true,       // 开启 HTML 标签解析，为了安全性，默认不开启
        htmlDecode: "style,script,iframe", // you can filter tags decode
        //toc             : false,
        tocm: true, // Using [TOCM]
        tocContainer: "#toc", // 自定义 ToC 容器层
        //gfm             : false,
        //tocDropdown     : true,
        // markdownSourceCode : true, // 是否保留 Markdown 源码，即是否删除保存源码的 Textarea 标签
        emoji: true,
        taskList: true,
        tex: true, // 默认不解析
        flowChart: true, // 默认不解析
        sequenceDiagram: true, // 默认不解析
    });
</script>
</body>
</html>
